{include file="public/header" /}
<body class="bgc hide-top">
<div class="pro-list-search">
    <i class="layui-icon layui-icon-left"  onclick="history.go(-1)"></i>
    <div class="rgt">
        <img src="/static/index/img/icon43.png" alt="">
        <input type="text" class="keyword" placeholder="请输入商品关键字搜索" value="{$keyword?:''}">
        <p class="flex-center search_bt">搜索</p>
    </div>
</div>
<!--<ul class="pro-list-nav">-->
<!--    <li class="active">-->
<!--        <div>综合</div>-->
<!--        <p></p>-->
<!--    </li>-->
<!--    <li>-->
<!--        <div>销量-->
<!--            <p class="flex-center">-->
<!--                <img src="/static/index/img/icon40.png" alt="">-->
<!--                &lt;!&ndash; <img src="/static/index/img/icon41.png" alt="">-->
<!--                <img src="/static/index/img/icon42.png" alt=""> &ndash;&gt;-->
<!--            </p>-->
<!--        </div>-->
<!--        <p></p>-->
<!--    </li>-->
<!--    <li>-->
<!--        <div>价格-->
<!--            <p class="flex-center">-->
<!--                &lt;!&ndash; <img src="/static/index/img/icon40.png" alt="">-->
<!--                <img src="/static/index/img/icon41.png" alt=""> &ndash;&gt;-->
<!--                <img src="/static/index/img/icon42.png" alt="">-->
<!--            </p>-->
<!--        </div>-->
<!--        <p></p>-->
<!--    </li>-->
<!--    <li>-->
<!--        <div>新品</div>-->
<!--        <p></p>-->
<!--    </li>-->
<!--</ul>-->

<div class="tpl_list"></div>

<script id="template" type="text/html">
    {{# if(d.data.length > 0){ }}
    <ul class="index-list">
        {{# for(var i = 0; i < d.data.length; i++){ }}
        <li>
            <a href="{:url('product/details')}?id={{d.data[i].id}}">
                <p class="flex-center">
                    <img lay-src="{{d.data[i].icon}}" src="{{d.data[i].icon}}" alt="">
                </p>
                <div>
                    <p class="multi">{{d.data[i].title}}</p>
                    <p class="price">{{# if(d.data[i].cate_1 == 2){ }} 会员价  {{# } }}￥<span>{{d.data[i].vip_price}}</span></p>
                    <p class="flex-layout" style="font-size: 0.75rem;color: var(--c9);text-decoration: line-through;"><span>{{# if(d.data[i].cate_1 == 2){ }} 市场价 {{# } }}￥{{d.data[i].price}}</span></p>
                </div>
            </a>
        </li>
        {{# } }}
    </ul>
    {{# }else { }}
    <div class="pro-list-data">
        <img src="/static/index/img/icon44.png" alt="">
        <p>暂无搜索结果</p>
    </div>
    {{# } }}
</script>

</body>
{include file="public/footer"/}
<script>
    $(function () {
        var end = '{$keyword?:""}' ? '没有更多了' : '没有更多了';
        getFlow(1, "{:url('product/getList')}?cate_1={$cate_1?:''}&keyword={$keyword?:''}", 'template', end);

        $(".search_bt").click(function () {
            var keyword = $(".keyword").val();
            if (!keyword) {
                layer.msg('请填写要搜索的内容');
                return false;
            }
            $(".tpl_list").empty();
            getFlow(1, "{:url('product/getList')}?cate_1={$cate_1?:''}&keyword=" + keyword, 'template', end);
        });
    })
</script>
</html>